﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InsideDL.MISService
{
    public class VerifyTickey:InsideDL.MISService.VerifyMatrix
    {

        #region iVerify Members

        //public bool Verify()
        //{
        //    throw new NotImplementedException();
        //}

        /// <summary>
        /// 0:currentYM，1:Utility.GetFTPFileList
        /// </summary>
        /// <param name="p_paras"></param>
        /// <returns></returns>
        public override bool CheckFileInFtp(object[] p_paras)
        {
            string currentYM;
            currentYM = Convert.ToString(p_paras[0]);
            string[] fileList = p_paras[1] as string[];  //Utility.GetFTPFileList(ftp, id, pw);
            downList = (from aa in
                                     (from fl in fileList
                                      where fl.IndexOf(".CSV") > 0
                                      orderby fl.Substring(8) descending
                                      select fl)
                                 where aa.Substring(8, 6).Equals(currentYM) &
                                    (aa.Substring(6, 1).Equals("A")
                                        || aa.Substring(6, 1).Equals("C")
                                        || aa.Substring(6, 1).Equals("D"))
                                 select aa).ToArray();
            return downList.Length == 3 ? true : false;
        }

       
        #endregion
        
    }
}
